<?php
  session_cache_limiter('private,must-revalide');
   /**
   * 处理上传页面
   */ 
  if ($_POST['btn_sub'])
  {
    $cate_id = 0; //分类
	//date_default_timezone_set('Asia/Shanghai');
	$time=date('Y-m-d');
	$time1=date('Y-m-d H:i:s');
    $mem_id = work_str($_POST["mem_id"], 1);		//中文标题
    $search = "SELECT * FROM $TBL_ADMIN WHERE mem_id='$mem_id'";
	$result = mysql_query( $search );
	if( @mysql_num_rows( $result ) > 0 )
	{
		MyNotice("該帳號已經存在！",1,'');
		exit();
	}
   	$name = work_str($_POST["name"], 1);				//中文内容	
	$note= work_str($_POST['note'],1);				//中文来源
	$password= work_str($_POST['pass'],1);
	$password=md5($password);
	
    $query = "INSERT INTO $TBL_ADMIN SET mem_id='$mem_id',name='$name',note='$note',addtime='$time1',password='$password'";	
    $res = mysql_query($query) or die(mysql_error());
	MyNotice("高級管理員添加成功", 2, "list4.php");
	exit(0);

  } 
  $tpl -> set_file(array("main" => "add_news.htm"));
  $tpl -> set_block("main","TYPE_LIST","type_list");
  $tpl -> set_var(array(
                         "SHOW_CATE" => $show_cate,
	     				 "CHINESE_EDIT" => $chinese_edit,
						 "ENGLISH_EDIT" => $english_edit,
						 "TIME" => $time1
                       )); 
  $tpl->set_var($conf);
  $tpl -> parse("Output", "main");
  $tpl -> p("Output");
  exit(0);
?>